home *** CD-ROM | disk | FTP | other *** search
- package javax.swing.plaf.basic;
-
- import java.io.File;
- import java.util.Hashtable;
- import javax.swing.Icon;
- import javax.swing.filechooser.FileView;
-
- public class BasicFileChooserUI$BasicFileView extends FileView {
- // $FF: synthetic field
- private final BasicFileChooserUI this$0;
- protected Hashtable iconCache;
-
- public BasicFileChooserUI$BasicFileView(BasicFileChooserUI var1) {
- this.this$0 = var1;
- this.iconCache = new Hashtable();
- }
-
- public void cacheIcon(File var1, Icon var2) {
- if (var1 != null && var2 != null) {
- this.iconCache.put(var1, var2);
- }
- }
-
- public void clearIconCache() {
- this.iconCache = new Hashtable();
- }
-
- public Icon getCachedIcon(File var1) {
- return (Icon)this.iconCache.get(var1);
- }
-
- public String getDescription(File var1) {
- return var1.getName();
- }
-
- public Icon getIcon(File var1) {
- Icon var2 = this.getCachedIcon(var1);
- if (var2 != null) {
- return var2;
- } else {
- if (var1 != null && var1.isDirectory()) {
- if (this.this$0.getFileChooser().getFileSystemView().isRoot(var1)) {
- var2 = this.this$0.hardDriveIcon;
- } else {
- var2 = this.this$0.directoryIcon;
- }
- } else {
- var2 = this.this$0.fileIcon;
- }
-
- this.cacheIcon(var1, var2);
- return var2;
- }
- }
-
- public String getName(File var1) {
- String var2 = null;
- if (var1 != null) {
- var2 = var1.getName();
- if (var2.equals("")) {
- var2 = var1.getPath();
- }
- }
-
- return var2;
- }
-
- public String getTypeDescription(File var1) {
- return var1.isDirectory() ? BasicFileChooserUI.access$2(this.this$0) : BasicFileChooserUI.access$3(this.this$0);
- }
-
- public Boolean isHidden(File var1) {
- String var2 = var1.getName();
- return var2 != null && var2.charAt(0) == '.' ? Boolean.TRUE : Boolean.FALSE;
- }
-
- public Boolean isTraversable(File var1) {
- return var1.isDirectory() ? Boolean.TRUE : Boolean.FALSE;
- }
- }
-